#include <nice2d/application.h>
#include <nice2d/components/defaultcamera.h>

IMPLEMENT_OBJECT(DefaultCamera,Component)

DefaultCamera::DefaultCamera()
{
}

DefaultCamera::~DefaultCamera()
{
}

void DefaultCamera::apply()
{
    auto window = Application::getInstance()->getWindow();
    if(window)
    {
        auto size = window->getSize();
        sf::View view;
        view.setSize({(float)size.x,(float)size.y});
        window->setView(view);
    }
}
